﻿using PayPal.Api;
using System;
using System.Collections.Generic;

namespace WebApplication2.Models
{
    public static class PaypalConfig
    {
        // private static String clientId= "AZ11r0EB_Pvrk4uWer94mvelruk8vybgp5aIcuq3T8hhPWlIIx4X7Hg5VF1vYLs3SFzsTYPgF0VxM-r1";
        // private static String clientSecret= "EI5ZdW8kl2XBpmExZFoJaM75nUVY6d5hBx3u7Vl-2IlK_ZOWmBJ2xTTkw8tZLWwklcBlhHUQDFJhV8mf";
        // private static String mode= "sandbox";
        
        private static String clientId= "AWhJo3pXOUgSqt3M_Uj-QjVH9mbD2bcuzI0Luq33PRpIAqGAr4Yj1yKplxklUK1OjW0jzxXOgDGhSrZx";
        private static String clientSecret= "ENJrIDYojKRLBRSj640E4Myihg6nVObwTyxSoWwjWKsVhAMWkNRcPcrgGbOIY2f48t60mmEA0hw4_dhu";
        private static String mode= "live";
        public static Dictionary<String, String> paypalSdkConfig()
        {
            Dictionary<String, String> sdkConfig = new Dictionary<string,string>();
            sdkConfig.Add("mode", mode);
            return sdkConfig;
        }
        public static OAuthTokenCredential authTokenCredential()
        {
            return new OAuthTokenCredential(clientId, clientSecret, paypalSdkConfig());
        }
        public static APIContext apiContext() 
        {
            APIContext apiContext = new APIContext(authTokenCredential().GetAccessToken());
            apiContext.Config = paypalSdkConfig();
            return apiContext;
        }
    }
}